package com.ouyy.volunteerservice.volunteer.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ouyy.volunteerservice.volunteer.domain.po.Volunteers;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface VolunteersMapper extends BaseMapper<Volunteers> {

    /**
     * 更新志愿者表的评分
     */
    @Update("UPDATE volunteers SET rating = #{avgScore} WHERE volunteer_id = #{volunteerId}")
    void updateVolunteerScore(@Param("volunteerId") Integer volunteerId, @Param("avgScore") Double avgScore);
}
